home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QRZ! Ham Radio 8
/
QRZ Ham Radio Callsign Database - Volume 8.iso
/
pc
/
files
/
ant_nec
/
nec_in_c.tz
/
nec_in_c
/
NEC2
/
s_cmp.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-02-13
|
505b
|
39 lines
#include "f2c.h"
integer s_cmp(a, b, la, lb) /* compare two strings */
register char *a, *b;
ftnlen la, lb;
{
register char *aend, *bend;
aend = a + la;
bend = b + lb;
if(la <= lb)
{
while(a < aend)
if(*a != *b)
return( *a - *b );
else
{ ++a; ++b; }
while(b < bend)
if(*b != ' ')
return( ' ' - *b );
else ++b;
}
else
{
while(b < bend)
if(*a == *b)
{ ++a; ++b; }
else
return( *a - *b );
while(a < aend)
if(*a != ' ')
return(*a - ' ');
else ++a;
}
return(0);
}